package com.lixianbiao.validation.processor;

import com.lixianbiao.validation.annotation.Max;
import com.lixianbiao.validation.annotation.Min;

import java.lang.annotation.Annotation;

/**
 * @author lixianbiao
 * @since 2024/06/22 14:01
 */
public class MinProcessor implements Processor{
    @Override
    public boolean process(Annotation annotation, Object object) {
        if( annotation instanceof Min && object instanceof Number){
            Min min = (Min) annotation;
            Number value = (Number) object;
            return value.longValue() > min.value();
        }else {
            throw new IllegalArgumentException();
        }
    }
}